<template>
	<div class="index" :style="{height: mainHeight+'px'}">
		<NavBarByUser @cancelLoginGuide="cancelLoginGuide" :isLogin="isLogin" :isShowLoginGuide="isShowLoginGuide"
		 :isShowCardCase="true" @loginSuccess="loginSuccess" @loginFailed="loginFailed" :avatarUrl.sync="avatarUrl" />

		<scroll-view :style="{height: scrollContentHeight+'px'}" class="dynamic-content" :scroll-y="true" :enable-back-to-top="true"
		 :scroll-anchoring="true" @scrolltoupper='scrolltoupper'>
			<Card_1 v-if="card_type == 1" :card_msg="card_msg" :isPrev="true"></Card_1>
			<div class="pb15 bgfff" v-else>
				<Card_2 v-if="card_type == 2" :card_msg="card_msg" @uploadpic="uploadpic" :isPrev="true"></Card_2>
				<Card_3 v-if="card_type == 3" :isPrev="true" :card_msg="card_msg"></Card_3>
				<Card_4 v-if="card_type == 4" :card_msg="card_msg"></Card_4>
			</div>
			<!-- <div class="pt15 card-case" @click.native="toCardCase">
                    <div class="disflex h30 bra_left_15 bg_line_blue cfff fs12 pl15 pr10 lh30 align-cen">
                        <img src="https://yueang2.oss-cn-qingdao.aliyuncs.com/yimai_photos/user/cardlist.png" alt class="w24 h24" />
                        <span class="pl7">名片夹</span>
                    </div>
                </div> -->
			<view>
				<FormId>
					<div class="disflex pl15 pr15 fs18 lh44 textc jsbet bgfff user-btn-group">
						<div>
							<div class="share_card w165  cblue bblue bgfff fs14 bradius5" open-type="share" hover-class="other-button-hover"
							 style="margin: 0;height:44px ;line-height: 44px;border: 1px solid green;color: green;">
								分享名片
							</div>
						</div>
						<div v-if="type == 0" class="bggreen  cfff w165 edit-btn fs14 bradius5" @click="updateMyCard" style="margin: 0;">
							编辑名片
						</div>
						<button v-else-if="type != 0 && hasCard" class="bggreen bradius5 cfff w165 fs14" hover-class="other-button-hover"
						 @click="SaveToCustomer" style="margin: 0">
							存为客户
						</button>
						<div v-else class="posre bggreen bradius5 cfff w165 flex-c-c create-card" style="margin: 0">
							<!-- <div class="fs18 lh44 h44"  @click="createCard">创建名片</div>    -->
							<button class="share_card w165 bradius5 cfff bggreen" @click="createCard" style="margin: 0">
								创建名片
							</button>
							<LoginIntercept @loginSuccess="loginInterceptSuccess" class="login-intercept" />
						</div>
					</div>
				</FormId>
			</view>
			<view>
				<div class="card_menu fs12 ca8 bgfff borderbox pl10 pr10">
					<div class="clearfix pt5 pb5 disflex operation-box">
						<FormId>
							<div class="shadow_gray textc bradius5 pt15 pl15 pr15 h65 mr10 business_card" @click="createCode">
								<p class="pb3">名片码</p>
								<div class="w20">
									<img src="https://yueang2.oss-cn-qingdao.aliyuncs.com/yimai_photos/user/ercode.png" alt=" " class="w20 h20" />
								</div>
							</div>
						</FormId>
						<FormId>
							<scroll-view scroll-x scroll-with-animation class="scroll-list" :scroll-left="scrollLeft">
								<div class="disflex ">
									<!-- <div class="shadow_gray textc pt15 pl15 pr15 h65 mr10" v-if="type == 0" @click="toShowBill">
										<p class="pb7">名片海报</p>
										<img src="https://yueang2.oss-cn-qingdao.aliyuncs.com/yimai_photos/crm/wx_timeline.png" alt=" " class="w20 h20" />
									</div> -->
									<!-- <div class="posre shadow_gray textc bradius5 pt15 pl15 pr15 h65 mr10">
										<GetPhoneNumber @next="addToAddressBook">
											<p class="pb7">同步到</p>
											<p>通讯录</p>

										</GetPhoneNumber>
										<LoginIntercept @loginSuccess="loginInterceptSuccess" class="login-intercept" />
									</div> -->
									<div class="posre shadow_gray textc bradius5 pt15 pl15 pr15 h65 mr10">
										<GetPhoneNumber @next="makePhone">
											<p class="disflex align-cen">
												<img src="https://yueang2.oss-cn-qingdao.aliyuncs.com/yimai_photos/user/tel.png" alt class="w16 h16" />
												<span class="pl9">拨打电话</span>
											</p>
											<p class="c78 fbold pt7">{{card_msg.tel || '未添加'}}</p>
										</GetPhoneNumber>
										<LoginIntercept @loginSuccess="loginInterceptSuccess" class="login-intercept" />
									</div>
									<div class="posre shadow_gray textc bradius5 pt15 pl15 pr15 h65 mr10">
										<GetPhoneNumber @next="addWx">
											<p class="disflex align-cen">
												<img src="https://yueang2.oss-cn-qingdao.aliyuncs.com/yimai_photos/user/msg.png" alt class="w16 h16" />
												<span class="pl9">添加微信</span>
											</p>
											<p class="c78 fbold pt7">{{card_msg.wx || '未添加'}}</p>
										</GetPhoneNumber>
										<LoginIntercept @loginSuccess="loginInterceptSuccess" class="login-intercept" />

									</div>
									<div class="posre shadow_gray textc bradius5 pt15 pl15 pr15 h65 mr10">
										<GetPhoneNumber>
											<p class="disflex align-cen">
												<img src="https://yueang2.oss-cn-qingdao.aliyuncs.com/product-index/20190425164542.png" alt class="w16 h16" />
												<span class="pl9">公司地址</span>
											</p>
											<p class="c78 fbold pt7">{{card_msg.address || '未添加'}}</p>
										</GetPhoneNumber>
										<LoginIntercept @loginSuccess="loginInterceptSuccess" class="login-intercept" />
									</div>
								</div>
							</scroll-view>
						</FormId>
					</div>
					<div class="more-info" @click="scrollviewRight">
						<img src="https://yueang2.oss-cn-qingdao.aliyuncs.com/product-index/20190514143457.png" alt class="left-img" />
					</div>
				</div>
			</view>
			<div class="seen_peo disflex pl15 pr26 fs10 pb15 ca8 jsbet bgfff">
				<div>
					<div class="disflex">
						<img v-for="(v,k) in card_msg.browsePhoto" :key="k" :src="v" alt mode="aspectFill" class="w20 h20 bradius3 mr3" />
					</div>
					<p class="lh20">已有{{card_msg.browseNum}}人浏览</p>
				</div>
				<div class="textc" @click="doThumbs">
					<img :src="isThumbs ? 'http://yueang2.oss-cn-qingdao.aliyuncs.com/product-index/20190418161136.png' : 'https://yueang2.oss-cn-qingdao.aliyuncs.com/yimai_photos/user/like.png' "
					 alt class="w20 h20 trans2" />
					<p>靠谱<span class="cpurple">{{card_msg.thumbsNum}}</span></p>
				</div>
			</div>
			<!--introduce begin-->
			<div class="c38 fs16 pl15 pr15">
				<image src="http://yueang2.oss-cn-qingdao.aliyuncs.com/wm-img/mycontent%20.png" class="mycontent-icon"></image>
				<p class="lh44 fs16 fbold" style="font-size: 27upx;">我的个人简介</p>
				<div class="shadow_gray pl15 pr15 bgfff bradius5">
					<div class="pt15 disflex pb20" v-if="audioArr.src">
						<img :src="card_msg.picchecked" mode="aspectFill" alt class="w40 h40 bradius5 mr15" />
						<div class="disinblock">
							<div class="output-audio">
								<!-- 默认状态 -->
								<div class="audio" v-if="audioArr.bl==false" @click="audioPlay" :data-id="audioArr.id" :data-bl="audioArr.bl">
									<img class="ico" src="https://yueang2.oss-cn-qingdao.aliyuncs.com/one-stand/card/yuyin-ico.png" />
								</div>
								<!-- 当前正在播放状态 -->
								<div class="audio" v-if="audioArr.bl==true" @click="audioStop" :data-id="audioArr.id" :data-bl="audioArr.bl">
									<img class="ico" src="https://yueang2.oss-cn-qingdao.aliyuncs.com/one-stand/card/yuyin-gif.gif" />
								</div>
							</div>
						</div>
						<span class="fs12 ca8 disflex column-reverse">{{audioArr.time + '"' || 0 + '"'}}</span>
					</div>
					<!--文字简介部分-->
					<div class="fs14 self_introduce lh22" :style="{height:seemore?introHeight : '' }" v-if="introduce">
						<div class="introduce pb20" :style="{'padding-top': audioArr.src ? '0' : '40rpx'}">{{introduce}}
						</div>
					</div>
					<!--家乡教育-->
					<div class="fs14 self_introduce lh22" :style="{height:seemore?introHeight : '' }" v-if="introduce">
						<div class="introduce pb20">家乡<br />{{cardaddressmodel.addressName}}
							<div :class="txclass" @click="isfellow(0)">同乡</div>
							<!--同乡 弹出层 -->
							<view class="uni-banner" style="background:#FFFFFF;border-radius: 15upx;" v-if="bannerShow">
								<view>
									<image src="https://img-cdn-qiniu.dcloud.net.cn/uniapp/images/shuijiao.jpg" style="width:100%;"></image>
								</view>
								<view class="why">
									<image src="http://yueang2.oss-cn-qingdao.aliyuncs.com/wm-img/demohead.png"></image>
									<text>老乡见老乡</text>
								</view>
								<view class="outbutton">
									<button @click="closewindow()" style="color: green;">还是算了</button>
									<button @click="talk()" style="background-color: green;color: white;">聊一聊</button>
								</view>
							</view>
							<view class="uni-mask" v-if="bannerShow"></view>
							<!-- 弹出层 -->
							<!--主页 弹出层 -->
							<view class="uni-banner" style="background:#FFFFFF;border-radius: 15upx;" v-if="bannerShow2">
								<view class="indexout">
									<image src="http://yueang2.oss-cn-qingdao.aliyuncs.com/wm-img/demohead.png"></image>
									<text>你好，欢迎进入到我的名片，有什么可以帮助您的吗？如有疑问可以在此与我沟通</text>
								</view>
								<view class="outbutton">
									<button @click="closewindow()" style="color: green;">还是算了</button>
									<button @click="talk()" style="background-color: green;color: white;">聊一聊</button>
								</view>
							</view>
							<view class="uni-mask" v-if="bannerShow2"></view>
							<!-- 弹出层 -->
						</div>
						<div class="introduce pb20">教育<br />{{cardschoolmodel.schoolName}}<br />
							<text style="font-size: 25upx;color:#888888;">{{cardschoolmodel.schoolTime}}
								{{cardschoolmodel.schoolProfessional}} {{cardschoolmodel.schoolRecord}} </text>
							<div :class="xyclass" @click="isschool(0)">校友</div>
						</div>
					</div>
					<!--标签点赞-->
					<div class="fs14 self_introduce lh22" :style="{height:seemore?introHeight : '' }" v-if="introduce">
						<div class="introduce pb20" :style="{'padding-top': audioArr.src ? '0' : '40rpx'}">
							<div :class="tagclass" @click="addmytaggreat(index,tag.businessLabelId)" v-for="(tag,index) in mytags" :key="index"
							 :style="{'border-color':tag.color}">
								<image :src="tag.tagimg"></image>
								<text :style="{'color':tag.color}">{{tag.businessLabelName}}</text>
								<text :style="{'color':tag.color}">{{tag.businessLabelNumber}}</text>
							</div>
						</div>

					</div>
					<!--评价-->
					<div class="fs14 self_introduce lh22" :style="{height:seemore?introHeight : '' }" v-if="introduce">
						<div class="introduce pb20" :style="{'padding-top': audioArr.src ? '0' : '40rpx'}">
							<text style="color: black;">别人的评价</text>
						</div>
						<div class="assessinfo" v-for="(assess,index) in assess" :key="index">
							<image :src="assess.userLogo"></image>
							<div class="assess-userinfo">
								<text style="color: #888888;font-size: 25upx;">{{assess.nickename}}</text>
								<text>{{assess.businessCommentsContent}}</text>
							</div>
							<div class="assess-likeinfo" @click="tapassessgreat(index,assess.businessCommentsId)">
								<image :src="assess.assessgreatimg"></image>
								<text :class="assess.classname" style="width: 30upx;margin-top: 15upx;">{{assess.businessCommentsNumber}}</text>
							</div>
						</div>
						<div class="divline"></div>
						<div class="moreassess" @click="moreassess()">
							<text>更多评价</text>
						</div>
						<view class="myaccess">
							<open-data type="userAvatarUrl"></open-data>
							<input class="uni-input" confirm-type="send" placeholder="我要评价" @confirm="sendcomment" name="commentinfo" />
						</view>
					</div>
				</div>
			</div>
			<!--公司官网-->
			<div class=" c38 fs16 pl15 pr15">
				<image src="http://yueang2.oss-cn-qingdao.aliyuncs.com/wm-img/mycontent%20.png" class="mycontent-icon"></image>
				<p class="lh44 fs16 fbold" style="font-size: 27upx;">公司官网</p>
				<div v-if="!introduce">
					<NoData>暂无数据</NoData>
				</div>
				<div class="shadow_gray pl15 pr15 bgfff bradius5">
					<div class="fs14 self_introduce lh22" :style="{height:seemore?introHeight : '' }" v-if="introduce">
						<div class="introduce pb20" :style="{'padding-top': audioArr.src ? '0' : '40rpx'}">
							<div class="company-info">
								<image :src="companymodel.companyLogo" style="width: 100upx;height: 100upx;"></image>
								<text style="width: 50%;">{{companymodel.companyName}}</text>
								<div @click="gotowebsite()">进入官网</div>
							</div>
							<!--下划线-->
							<view class="divLine"></view>
							<!--企业标签-->
							<div class="company-tag" v-for="(companyLabel,index) in companyLabelModel">
								<text>{{companyLabel.companyLabelName}}</text>
							</div>
							<image :src="companymodel.photos"></image>
							<div>
								<text>{{companymodel.goodsIntroduce}}
								</text>
							</div>
						</div>

					</div>
				</div>
			</div>
			<!--优秀员工-->
			<!-- <div class=" c38 fs16 pl15 pr15">
				<image src="http://yueang2.oss-cn-qingdao.aliyuncs.com/wm-img/employees.png" class="mycontent-icon"></image>
				<p class="lh44 fs16 fbold" style="font-size: 27upx;">优秀员工</p>
				<div class="shadow_gray pl15 pr15 bgfff bradius5">
					<div class="fs14 self_introduce lh22" :style="{height:seemore?introHeight : '' }" v-if="introduce">
						<div class="introduce pb20" :style="{'padding-top': audioArr.src ? '0' : '40rpx'}">
							<div class="employees-info" v-for="(employee,index) in employeesmodel" :key="index" :id="'employee-'+index">
								
								<image :src="employee.employeesPhoto"></image>
								
								<div>
									<text style="font-size: 30upx;font-weight: 600;margin-bottom: 10upx;margin-top: 10upx;">{{employee.employeesName}}</text>
									<text style="font-size: 25upx;">{{companymodel.companyName}}</text>
									<text style="font-size: 25upx;">{{employee.employeesPosition}}</text>
								</div>
							</div>
						</div>

					</div>
				</div>
			</div> -->
			<!--推荐商品-->
			<div class=" c38 fs16 pl15 pr15">
				<image src="http://yueang2.oss-cn-qingdao.aliyuncs.com/wm-img/goods.png" class="mycontent-icon"></image>
				<p class="lh44 fs16 fbold" style="font-size: 27upx;">推荐商品</p>
				
				<div style="float: right;margin-top: -60upx;font-size: 25upx" @click="moregoods()">更多 <view class='arrow'></view>
				</div>
				
				<div class="shadow_gray pl15 pr15 bgfff bradius5">
					<div class="fs14 self_introduce lh22" :style="{height:seemore?introHeight : '' }">
						<div class="introduce pb20" :style="{'padding-top': audioArr.src ? '0' : '40rpx'}">
							<div class="goods" v-for="(good,index) in goods" :key="index" :id="'good-'+index">
								<image :src="good.goodPhoto"></image>
								<div class="goods-info">
									<text>{{good.goodsName}}</text>
									<text style="margin-top: 0;">￥{{good.price}}</text>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<!--公司视频-->

			<div class="pl15 pr15">
				<!-- v-if="currentCompany.videoList"-->
				<image src="http://yueang2.oss-cn-qingdao.aliyuncs.com/wm-img/goods.png" class="mycontent-icon"></image>
				<p class="lh44 fs16 fbold" style="font-size: 27upx;">视频展示</p>
				<div v-if="!this.currentCompany.videoList.length">
					<NoData>暂无数据</NoData>
				</div>
				<div class="disflex wrap jsbet">
					<!--<div class="bgfff h211 shadow_gray">{{}}</div>-->
					<div v-for="(videoItem, index) in currentCompany.videoList" :key="index" class="bgfff overhidden" :class=" index === 0 ? 'firstVideo' : 'notFirstVideo'">
						<video :id="'myVideo'+ videoItem.videoId" class="disblock" v-if="playIndex === videoItem.videoId" :title="videoItem.videoTitle"
						 :poster="videoItem.videoCover || ''" :src="videoItem.videoUrl" objectFit="cover" enable-danmu danmu-btn controls
						 :autoplay="true"></video>
						<div class="posre" :class="index === 0 ? 'w100p h194' : 'w168 h94'" @click="showVideo(videoItem.videoId)" v-else>
							<img mode="aspectFill" :src="videoItem.videoCover || 'https://yueang2.oss-cn-qingdao.aliyuncs.com//one-www/photo/20190604/1559619324240.png'"
							 alt :class="index === 0 ? 'w100p h194' : 'w168 h94'" />
							<img src="https://yueang2.oss-cn-qingdao.aliyuncs.com//one-www/photo/20190604/1559619365051.png" alt class="w50 h50 posab top0 left0 right0 bottom0 mauto" />
						</div>
						<div class="fs14 pl15 c38 fbold">{{videoItem.videoTitle}}</div>

					</div>
					
				</div>
			</div>
			<!--动态-->
			<div class="c38 fs16 pl15 pr15">
				<image src="http://yueang2.oss-cn-qingdao.aliyuncs.com/wm-img/goods.png" class="mycontent-icon"></image>
				<p class="lh44 fs16 fbold" style="font-size: 27upx;">动态展示</p>
			</div>
			<div>

				<!--动态导入-->
				<!--lists begin-->
				<template v-if="dynamic_lists.length">
					<div v-for="(dynamic_item, k1) in dynamic_lists" :key="k1" style="position: relative;">
						<DynamicItem :dynamic_item="dynamic_item" @operate_tap="operate_tap" @addComment="addComment" @zan="zan"
						 @getMoreComment="getMoreComment" :index1="k1"></DynamicItem>
						<LoginIntercept />
					</div>
					<div class="textc lh42 fs12 ca8 bgf5f6" v-if="nodata">
						- 到底了，看看其他的吧 -
					</div>
				</template>
				<div v-else>
					<NoData>暂无数据</NoData>
				</div>

				<!--lists end-->
			</div>
			<!--introduce end-->
			<!--pic begin-->
			<div class="pl15 pr15">
				<!--<div class="bgf5f6 c38 fs16" v-if="self_photos.length">-->
				<image src="http://yueang2.oss-cn-qingdao.aliyuncs.com/wm-img/goods.png" class="mycontent-icon"></image>

				<p class="lh44 fs16 fbold" style="font-size: 27upx;">更多展示</p>
				<!-- 没有照片直接不显示此模块，此处不要 -->
				<!-- <div class="textc shadow_gray pl15 pr15 bgfff bradius5" style="height: 104px" v-if="self_photos.length == 0">
                暂无图片
                </div>-->
				<div>
					<img :lazy-load="true" :src="v" alt v-for="(v,k) in self_photos" :key="k" mode="widthFix" class="w100p h375"
					 @click="previewImage(v)" />
				</div>
			</div>
			<!--pic end-->
			<!--bottom-->
			<div class="textc lh42 fs12 ca8 bgf5f6">- 到底了，看看其他的吧 -</div>
			<!--右边悬浮框-->
			<!-- <div class="index_float_right trans2 overhidden">
                <RightFloat :isShow="isShow" @clickRightRowEvent="clickRightRowEvent"></RightFloat>
                <div :class="{fadeInRight: !isShow, fadeOutRight: isShow}" style="width: 40rpx;right: 0;border-top-left-radius: 10rpx;border-bottom-left-radius: 10rpx" class="animated posfix fs10 ca8 textc floats trans2 bottom30 shadow_gray bgfff pb15" >
                    <div class="pt16" @click="clickRightRowEvent">
                        <img src="https://yueang2.oss-cn-qingdao.aliyuncs.com/yimai_photos/user/right_row.png" alt style="width: 30rpx;transform: rotate(180deg);height: 30rpx;" />
                    </div>
                </div>
            </div> -->
			<div v-if="isShowCourse">
				<addWxCourse top='136rpx' :isShow="isShowCourse" @close="isShowCourse=false" />
			</div>
		</scroll-view>

		<FloatButtons class="index_float_right trans2 overhidden" :isShowTalk="isShowTalk" :avatarUrl="targetAvatarUrl" @talk="talk"
		 @loginInterceptSuccess="loginInterceptSuccess"></FloatButtons>
	</div>
</template>
<script>
	let myaudio = wx.createInnerAudioContext();

	myaudio.obeyMuteSwitch = false;
	import NoData from "@/components/noData";
	import DynamicItem from "@/components/dynamicItem"; // 订单项
	import chatInput from '../../components/im-chat/chatinput.vue'; //input框
	import postData from '../../common/index/index.post.data.js'; //朋友圈数据
	import goodsData from '../../common/index/index.goods.data.js'; //商品数据
	import employeeData from "../../common/index/index.employees.data.js" //优秀员工数据
	import RightFloat from "@/components/rightFloat"; //
	import FloatButtons from "@/components/FloatButtons.vue"
	import GetPhoneNumber from "@/components/getPhoneNumber"; //
	import AddWxCourse from "@/components/addWxCourse";
	import Card_1 from "@/components/card_1"; //
	import Card_2 from "@/components/card_2"; //
	import Card_3 from "@/components/card_3"; //
	import Card_4 from "@/components/card_4"; //
	import FormId from "@/components/formId";
	import NavBarByUser from '@/components/NavBarByUser.vue';
	import {
		mapActions,
		mapGetters
	} from "vuex";
	import WXAJAX from "../../utils/request";
	import util from "../../utils/index";
	import HandleLogin from '@/utils/handleLogin'
	import LoginIntercept from "@/components/LoginIntercept";
	import { toMiniProgram } from '@/utils';
	var SESSION_KEY = 'denglutai'

	export default {
		data() {
			return {
				dynamic_lists: [], //动态列表
				employeesmodel: [], //员工数据
				companymodel: [], //官网数据
				companyLabelModel: [], //官网标签数据
				tagclass: "mytag", //标签class
				cardaddressmodel: [], //家乡数据
				cardschoolmodel: [], //学校数据
				bannerShow2: false,
				bannerShow: false,
				assess: [], //评价数据
				txclass: 'tx',
				xyclass: 'xy',
				mytags: [], //标签数据

				goods: [], //商品数据
				//动态end

				introduce: "", //介绍
				seemore: false,
				introHeight: "",
				cardaddress: {
					addressId: "0",
					addressName: "",
					addressGreetings: ""

				},

				//音频列表
				audioArr: {
					id: "0",
					src: "",
					time: "",
					bl: false,
					startTime: 0
				},
				card_type: 1, //名片样式
				type: 0, //0我的名片，1别人名片
				card_msg: { //名片信息
					username: '',
					post: '',
					tel: '',
					company_logo: '',
					picchecked: '',
					company: ''

				},
				COMPANYID: 0,
				CARDID: 0,
				playIndex: "",
				moreShow: false,
				self_photos: [],
				isThumbs: 0, //是否点赞
				right_float_show: false, //右边悬浮框
				goType: 0, // 0小程序进入，1分享进入
				hasCard: false, //  是否有名片
				isShowCourse: false,
				isShow: true,
				avatarUrl: '', //用户的头像地址,
				isLogin: HandleLogin.returnIsLogin() || false, //是否已经登录
				isShowTalk: true, //是否显示右边侧边栏的聊一聊
				isShowLoginGuide: true, //是否显示登录引导页,
				targetAvatarUrl: '', //当前目标的人物头像
				scrollContentHeight: 0, //中间滚动区域的高度
				mainHeight: 0, //整体高度
				scrollLeft: 0,
			};
		},
		components: {
			RightFloat,
			Card_1,
			Card_2,
			Card_3,
			Card_4,
			FormId,
			GetPhoneNumber,
			AddWxCourse,
			NavBarByUser,
			FloatButtons,
			LoginIntercept,
			chatInput,
			DynamicItem,
			NoData
		},
		mounted() {

			uni.getStorage({
				key: 'posts',
				success: function(res) {
					console.log(res.data);
					this.posts = res.data;
				}
			});
		},
		onShareAppMessage(e) {
			const {
				name,
				companyName,
				position
			} = this.currentCompany;
			let shareSpeech = (this.currentCompany || '').shareSpeech || '';
			try {
				shareSpeech = shareSpeech.replace('#name#', name).replace('#company#', companyName);
			} catch (e) {
				console.error("获取分享语出现错误");
			}

			return {
				title: shareSpeech || `您好，我是${companyName || ''}的${position || ''}${name || ''}，敬请惠存!`,
				path: '/pages/index/main?cardId=' + this.CARDID + '&companyId=' + this.COMPANYID + '&goType=1',
				success(e) {
					wx.showShareMenu({
						withShareTicket: true
					});
				},
				fail(e) {
					console.log("失败分享名片--- ", e);
				}
			};
		},
		async onLoad(options) {
			if (options.cardId) {
				//从分享的名片页面进入
				wx.setStorageSync("COMPANYID", options.companyId);
				wx.setStorageSync("CARDID", options.cardId);
				this.goType = options.goType;
			} else if (!wx.getStorageSync("COMPANYID") || !wx.getStorageSync("CARDID")) {
				// 在缓存中存在COMPANYID和CARDID标识 通过太阳码扫码进入，在APP.vue中已经设置了COMPANYID和CARDID，则直接查询太阳码扫码进入的名片详情
				// 如果没有，则需要查询默认名片
				this.getAllCard();
				this.inits_dynamic();
			}
		},
		onLoad() {
			var that = this;
			uni.getSystemInfo({ //获取设备信息
				success: (res) => {
					this.screenHeight = res.screenHeight;
					this.platform = res.platform;
				}
			});
			uni.startPullDownRefresh();
			//20秒后弹出页面
			setTimeout(function() {
				that.bannerShow2 = true;
			}, 2000);
			this.inits_dynamic();
		},
		onShow() {
			//获取名片的公司
			let lastCardId = this.CARDID;
			this.COMPANYID = wx.getStorageSync("COMPANYID") || 0;
			this.CARDID = wx.getStorageSync("CARDID") || 0;
			this.hasCard = wx.getStorageSync("hasCard");
			this.avatarUrl = wx.getStorageSync('avatarUrl') || '';
			this.isLogin = HandleLogin.returnIsLogin() || false;

			//缓存存储的cardid和当前页面的cardid不相等，或者 当前的card_msg 不存在，或者编辑卡片后返回
			let refreshCard = wx.getStorageSync("refreshCard") || false;
			if (lastCardId !== this.CARDID || !this.card_msg.cardId || refreshCard) {
				wx.removeStorageSync("refreshCard");
				this.inits();
			}

			uni.onWindowResize((res) => { //监听窗口尺寸变化,窗口尺寸不包括底部导航栏
				if (this.platform === 'ios') {
					this.windowHeight = res.size.windowHeight;
					this.adjust();
				} else {
					if (this.screenHeight - res.size.windowHeight > 60 && this.windowHeight <= res.size.windowHeight) {
						this.windowHeight = res.size.windowHeight;
						this.adjust();
					}
				}
			});
		},
		onHide() {
			myaudio.stop();
			uni.offWindowResize(); //取消监听窗口尺寸变化
		},
		onUnload() {
			this.max = 0,
				this.data = [],
				this.loadMoreText = "加载更多",
				this.showLoadMore = false;
		},
		onReachBottom() { //监听上拉触底事件
			console.log('onReachBottom');
			this.showLoadMore = true;
			setTimeout(() => {
				//获取数据
				if (this.posts.length < 20) { //测试数据
					this.posts = this.posts.concat(this.posts);
				} else {
					this.loadMoreText = "暂无更多";
				}
			}, 1000);
		},
		onPullDownRefresh() { //监听下拉刷新动作
			console.log('onPullDownRefresh');
			// 这里获取数据
			setTimeout(function() {
				//初始化数据
				uni.stopPullDownRefresh(); //停止下拉刷新
			}, 1000);
		},
		onNavigationBarButtonTap(e) { //监听标题栏点击事件
			if (e.index == 0) {
				this.navigateTo('../publish/publish')
			}
		},
		async onPullDownRefresh() {
			// to doing..
			// 停止下拉刷新
			// wx.showNavigationBarLoading();
			// this.inits(1);
			// wx.stopPullDownRefresh();
			// setTimeout(function () {
			//     wx.hideNavigationBarLoading();
			// }, 300);
		},
		onPageScroll() {
			this.right_float_show = false;
		},
		computed: {
			...mapGetters(["currentCompany"]),
		},
		async mounted() {
			let a = await util.systemIfo();
			this.mainHeight = a.windowHeight;
			this.scrollContentHeight = a.windowHeight - getApp().globalData.navHeight;
		},

		methods: {
			...mapActions(["setCurrentCompany"]),
			addComment(index1, replayComment) {
				//添加评论
				let isLogin = HandleLogin.returnIsLogin();
				if (!isLogin) {
					uni.showToast({
						title: "请先登录,才可以评论喔",
						icon: "none"
					});
					return;
				}
				if (
					(replayComment.userName && !replayComment.commentId) ||
					(replayComment.commentId &&
						replayComment.userId == wx.getStorageSync("userId"))
				) {
					return;
				}

				this.input_show = true;
				this.replayComment = replayComment;
				// this.comment_focus = true ;
				this.add_comments_index = index1;
				let v = this;
				setTimeout(function() {
					v.$set(v.dynamic_lists[index1], "operate_show", false);
					v.comment_focus = true;
				}, 200);
			},
			zan(index1, isThumbs, dynamicId) {
				//点赞
				let isLogin = HandleLogin.returnIsLogin();
				if (!isLogin) {
					uni.showToast({
						title: "请先登录,才可以点赞喔",
						icon: "none"
					});
					return;
				}

				let v = this;
				wx.showLoading();
				WXAJAX.POST({
							dynamicId: dynamicId,
							cardId: wx.getStorageSync("CARDID")
						},
						"",
						"/personal/doDynamicThumbs"
					)
					.then(data => {
						wx.hideLoading();
						if (data) {
							//点赞
							v.dynamic_lists[index1].doThumbsName.push(data); //添加人名
							v.$set(v.dynamic_lists[index1], "isThumbs", 1);
							v.$set(
								v.dynamic_lists[index1],
								"doThumbsNum",
								++v.dynamic_lists[index1].doThumbsNum
							);
						} else {
							v.dynamic_lists[index1].doThumbsName.pop();
							v.$set(v.dynamic_lists[index1], "isThumbs", 0);
							v.$set(
								v.dynamic_lists[index1],
								"doThumbsNum",
								--v.dynamic_lists[index1].doThumbsNum
							);
						}
						let status = !v.dynamic_lists[index1].operate_show;
						v.$set(v.dynamic_lists[index1], "operate_show", status);
					})
					.catch(err => {
						console.log(err);
						wx.hideLoading();
					});
			},
			addComment(index1, replayComment) {
				//添加评论
				let isLogin = HandleLogin.returnIsLogin();
				if (!isLogin) {
					uni.showToast({
						title: "请先登录,才可以评论喔",
						icon: "none"
					});
					return;
				}
				if (
					(replayComment.userName && !replayComment.commentId) ||
					(replayComment.commentId &&
						replayComment.userId == wx.getStorageSync("userId"))
				) {
					return;
				}

				this.input_show = true;
				this.replayComment = replayComment;
				// this.comment_focus = true ;
				this.add_comments_index = index1;
				let v = this;
				setTimeout(function() {
					v.$set(v.dynamic_lists[index1], "operate_show", false);
					v.comment_focus = true;
				}, 200);
			},
			operate_tap(index) {
				//显示点赞或者评论
				let status = !this.dynamic_lists[index].operate_show;
				this.$set(this.dynamic_lists[index], "operate_show", status);
			},
			//关闭模态窗
			closewindow() {
				this.bannerShow = false;
				this.bannerShow2 = false;
			},

			//跳转官网
			gotowebsite() {
				uni.switchTab({
					url: '/pages/WebSite/main'
				})
			},
			//跳转商城
			gotoshop() {
				uni.switchTab({
					url: '/pages/Product/main'
				})
			},
			//评论点赞
			tapassessgreat(index,id) {
				if (this.assess[index].isCardCommentsGreat == 0) {
					
					this.assess[index].classname = "assesscount2";
					var i = this.assess[index].businessCommentsNumber;
					i++
					this.assess[index].businessCommentsNumber = i;
					this.assess[index].assessgreatimg = "http://yueang2.oss-cn-qingdao.aliyuncs.com/wm-img/dianzn.png";
					WXAJAX.POST(
					  {
					    businessCommentsId: id,
					  },
					  "",
					  "/businessCard/isCommentsGreat"
					)
					this.assess[index].isCardCommentsGreat = 1
				} else {
					uni.showToast({
						title: '你已经点过赞了',
						icon :'none'
					});
				}
			},
			moregoods(){
				uni.switchTab({
					url:'../Product/main'
				})
			},
			//同乡
			isfellow(type) {
				//点击
				if (type == 0) {
					this.txclass = "tx2";
					this.bannerShow = true;
					WXAJAX.POST({
							isSame: 1,
						},
						"",
						"/businessCard/isSame"
					)
				} else {
					this.txclass = "tx2";
				}

			},
			isschool(type) {
				if (type == 0) {
					this.xyclass = "xy2"
					WXAJAX.POST({
							isSame: 2,
						},
						"",
						"/businessCard/isSame"
					)
				} else {
					this.xyclass = "xy2"

				}


			},
			moreassess(){
				uni.navigateTo({
					url:"../moreassess/moreassess"
				});
			},
			sendcomment(event){
				var commentinfo=event.detail.value;
				WXAJAX.POST({
						businessCommentsContent: commentinfo,
					},
					"",
					"/businessCard/addCardComments"
				).then((data)=>{
					if(data){
						uni.showToast({
							title:'评价成功',
							icon:'none'
						});
						//更新数据
						var nickeName=data.nickeName;
						var avatarUrl=data.avatarUrl;
						this.assess.push({
							nickename:nickeName,
							userLogo:avatarUrl,
							businessCommentsContent:commentinfo,
							isCardCommentsGreat:0,
							businessCommentsNumber:0,
							
							assessgreatimg:"http://yueang2.oss-cn-qingdao.aliyuncs.com/wm-img/dianzan_d.png"
						})
					}
				})
				
			},
			//给个人标签点赞
			addmytaggreat(index, id) {
				if(this.mytags[index].color=="green"&&this.mytags[index].tagimg == "http://yueang2.oss-cn-qingdao.aliyuncs.com/wm-img/dianzn.png"){
					uni.showToast({
						title:"你已经点过赞了",
						icon:"none"
					});
				}else{
					//设置颜色
					this.mytags[index].color = "green";
					//设置点赞图片变化
					this.mytags[index].tagimg = "http://yueang2.oss-cn-qingdao.aliyuncs.com/wm-img/dianzn.png";
					
					var tagnumber = this.mytags[index].businessLabelNumber;
					tagnumber++;
					this.mytags[index].businessLabelNumber = tagnumber;
					WXAJAX.POST({
							businessLabelId: id,
						},
						"",
						"/businessCard/isGreat"
					)
				}
			},
		
			getAllCard() {
				WXAJAX.POST({
					name: '',
					pageNum: 1,
				}, '', '/businessCard/seeDetail', '1').then((data) => {
					let selfCard = null;
					let defaultCard = null;
					// state : 1 -- 默认 ， 2 -- 浏览记录 ， 3 -- 自己的
					if (data) {
						console.log("seeDetail")
						console.log(data)
						for (let index = 0; index < data.length; index++) {
							if (selfCard || defaultCard) {
								break;
							}
							const i = data[index];
							const cardData = {
								picchecked: i.logo || '',
								username: i.name || '',
								tel: i.phone || '',
								wx: i.personalWx || '',
								company_wx: i.companyWx || '',
								email: i.email || '',
								post: i.position || '',
								company: i.companyName,
								company_logo: i.companyLogo,
								cardId: i.cardId,
								companyId: i.companyId,
								recordId: i.recordId,
								shareSpeech: i.shareSpeech || '',
							};
							console.log("判断名片状态：1.别人 2.浏览记录 3.自己"+i.state)
							if (i.state === 3) {
								selfCard = cardData;
							} else if (i.state === 1) { //默认名片
								if (defaultCard == null) {
									defaultCard = cardData;
								}
							}
						}
						if (selfCard) {
							console.log(selfCard);
							this.CARDID = selfCard.cardId;
							wx.setStorageSync("CARDID", selfCard.cardId);
							wx.setStorageSync("COMPANYID", selfCard.companyId);
						} else if (defaultCard) {
							this.CARDID = defaultCard.cardId;
							wx.setStorageSync("CARDID", defaultCard.cardId);
							wx.setStorageSync("COMPANYID", defaultCard.companyId);
						}

						if (this.CARDID) {
							this.inits(1);
						}
					}
				}).catch((err) => {
					if (err.code == 401) {
						this.islogin = false;
					}
				});
			},
			test() {
				this.navigateTo('../test/test');
			},
			navigateTo(url) {
				uni.navigateTo({
					url: url
				});
			},
			like(index) {
				if (this.posts[index].islike === 0) {
					this.posts[index].islike = 1;
					this.posts[index].like.push({
						"uid": this.user_id,
						"username": "," + this.username
					});
				} else {
					this.posts[index].islike = 0;
					this.posts[index].like.splice(this.posts[index].like.indexOf({
						"uid": this.user_id,
						"username": "," + this.username
					}), 1);
				}
			},
			comment(index) {
				this.showInput = true; //调起input框
				this.focus = true;
				this.index = index;
			},
			adjust() { //当弹出软键盘发生评论动作时,调整页面位置pageScrollTo
				return;
				uni.createSelectorQuery().selectViewport().scrollOffset(res => {
					var scrollTop = res.scrollTop;
					let view = uni.createSelectorQuery().select("#post-" + this.index);
					view.boundingClientRect(data => {
						console.log("data:" + JSON.stringify(data));
						console.log("手机屏幕高度:" + this.screenHeight);
						console.log("竖直滚动位置" + scrollTop);
						console.log("节点离页面顶部的距离为" + data.top);
						console.log("节点高度为" + data.height);
						console.log("窗口高度为" + this.windowHeight);

						uni.pageScrollTo({
							scrollTop: scrollTop - (this.windowHeight - (data.height + data.top + 45)), //一顿乱算
							// scrollTop: 50, 
							duration: 300
						});
					}).exec();
				}).exec();
			},
			reply(index, comment_index) {
				this.is_reply = true; //回复中
				this.showInput = true; //调起input框
				let replyTo = this.posts[index].comments.comment[comment_index].username;
				this.input_placeholder = '回复' + replyTo;
				this.index = index; //post索引
				this.comment_index = comment_index; //评论索引
				this.focus = true;
			},
			blur: function() {
				this.init_input();
			},
			send_comment: function(message) {

				if (this.is_reply) {
					var reply_username = this.posts[this.index].comments.comment[this.comment_index].username;
					var comment_content = '回复' + reply_username + ':' + message.content;
				} else {
					var comment_content = message.content;
				}
				this.posts[this.index].comments.total += 1;
				this.posts[this.index].comments.comment.push({
					"uid": this.user_id,
					"username": this.username,
					"content": comment_content //直接获取input中的值
				});
				this.init_input();
			},
			init_input() {
				this.showInput = false;
				this.focus = false;
				this.input_placeholder = '评论';
				this.is_reply = false;
			},
			previewImage(imageList, image_index) {
				var current = imageList[image_index];
				uni.previewImage({
					current: current,
					urls: imageList
				});
			},
			goPublish() {
				uni.navigateTo({
					url: './publish/publish',
					success: res => {},
					fail: () => {},
					complete: () => {}
				});
			},
			scrollviewRight() {
				this.scrollLeft += 280;
			},
			//下拉刷新
			scrolltoupper(e) {
				// wx.showLoading({
				// title: '获取最新数据中',
				// });
				this.inits(1);
			},
			clickOne() {
				console.log('click');
			},
			clickRightRowEvent() {
				this.isShow = !this.isShow;
			},
			//隐藏登录引导
			cancelLoginGuide() {
				this.isShowLoginGuide = false;
			},
			//需要登录引导的回调
			loginGuide() {
				this.isShowLoginGuide = true;

			},
			//聊一聊
			talk() {
				wx.navigateTo({
					url: '../IM/main?userId=' + this.currentCompany.userId +
						'&logo=' + this.currentCompany.logo +
						'&type=2&cardId=' + this.currentCompany.cardId +
						'&name=' + this.currentCompany.name +
						'&wxCode=' + (this.currentCompany.personalWx || "") +
						'&phone=' + this.currentCompany.phone
				});
			},
			//头像登录成功的回调
			loginSuccess(url) {
				this.loginInterceptSuccess();
				this.getAllCard();
				this.inits_dynamic();

			},
			// 其他监听事件登录 成功回调
			loginInterceptSuccess() {
				this.isLogin = true;
				this.hasCard = wx.getStorageSync('hasCard') || false;
				this.avatarUrl = wx.getStorageSync('avatarUrl') || '';
			},
			loginFailed() {
				this.isShowLoginGuide = true;
			},

			toShowBill() {
				if (!HandleLogin.returnIsLogin()) {
					this.loginGuide();
					return;
				}
				wx.navigateTo({
					url: '/pages/showBill/main?cardId=' + this.CARDID
				});
			},
			showVideo(index) {
				this.playIndex = index;
			},
			inits(refresh) {
				this.findCardDetail(refresh);

			},
			inits_dynamic(refresh = "") {
				//动态
				let v = this;
				if (v.isLoading) {
					wx.hideLoading();
					return;
				}
				v.isLoading = true;
				// wx.showLoading();
				WXAJAX.POST({
							companyId: 1,
							pageNum: 1,
							refresh,
							cardId: 2
						},
						"",
						"/personal/getDynamicInfo"
					)
					.then((data, code) => {
						wx.hideLoading();
						console.log(data)
						if (data) {
							// wx.showToast({
							//   title: '更新成功',
							//   icon: 'success',
							//   duration: 1000
							// })
							let nowTime = +new Date(),
								addTime = "",
								diff = 0;
							data.forEach(function(i, k) {
								i.photos = i.photos ? i.photos.split(",") : [];
								i.createTime = util.getdate(i.createTime, "dateTime");
								i.doThumbsName = i.doThumbsName ? i.doThumbsName.split(",") : [];
								/*addTime = +new Date(i.createTime);
				      diff = nowTime - addTime ;
				      if( diff < 60*60*1000){
				          console.log('超出一小时');
				          i.createTime = diff / 1000 / 60 ;
				          i.createTime = i.createTime +'分钟前' ;
				      }*/
							});
							v.dynamic_lists = [...v.dynamic_lists, ...data];
							console.log(v.dynamic_lists)
							v.page++;
							setTimeout(function() {
								v.isLoading = false;
							}, 500);
						} else {
							// wx.showToast({
							//   title: '没有更多信息',
							//   icon: 'success',
							//   duration: 1000
							// })
							// setTimeout(function () {
							//   v.nodata = true ;
							//   v.isLoading = false ;
							// },500);
						}
					})
					.catch(err => {
						console.log(err);
						wx.hideLoading();
						if (err.code == 204) {
							v.nodata = true;
						}
						setTimeout(function() {
							v.isLoading = false;
						}, 500);
					});
			},
			findCardDetail(refresh) {
				let url = '/businessCard/cardDetails';
				//获取数据
				// wx.showLoading();
				WXAJAX.POST({
					cardId: this.CARDID,
					refresh: refresh || '',
				}, '', url).then((data, code) => {
					wx.hideLoading();
					if (data) {
						console.log(data)
						if (data.soundRecording) {
							this.audioArr = {
								bl: false,
								time: data.soundTime || 0,
								id: 1,
								src: data.soundRecording
							};
						} else {
							this.audioArr = {
								bl: false,
								time: 0,
								id: 1,
								src: ''
							};
						}
						//set家乡数据
						this.cardaddressmodel = {
							addressGreetings: data.cardAddressModel.addressGreetings,
							addressName: data.cardAddressModel.addressName,
							isSameAddress: data.cardAddressModel.isSameAddress
						};
						//如果是同乡判断
						if (this.cardaddressmodel.isSameAddress == 1) {
							this.isfellow(1);
						}
						//set学校数据
						this.cardschoolmodel = {
							schoolGreetings: data.cardSchoolModel.schoolGreetings,
							schoolName: data.cardSchoolModel.schoolName,
							schoolProfessional: data.cardSchoolModel.schoolProfessional,
							schoolRecord: data.cardSchoolModel.schoolRecord,
							schoolTime: data.cardSchoolModel.schoolTime,
							isSameSchool: data.cardSchoolModel.isSameSchool

						};
						//如果是同校判断
						if (this.cardschoolmodel.isSameSchool == 1) {
							this.isschool(1);
						}
						//set标签数据
						this.mytags = data.businessLabelModel;

						this.mytags.forEach(item => { //一顿乱算
							this.$set(item, 'color', "#B2B2B2");
							this.$set(item, "tagimg", "http://yueang2.oss-cn-qingdao.aliyuncs.com/wm-img/dianzan_d.png");
							if (item.isCardLabelGreat == 1) {
								item.color = "green";
								item.tagimg = "http://yueang2.oss-cn-qingdao.aliyuncs.com/wm-img/dianzn.png";
							}
						})
						//名片标签点赞回显

						//set官网标签数据
						this.companyLabelModel = data.companyLabelModel;
						//set官网其它数据
						this.companymodel = data.websiteModel;
						//设置员工数据
						this.employeesmodel = data.companyEmployeesModel;
						//设置推荐商品
						this.goods = data.goodsModel;
						//设置名片评价
						this.assess = data.commentsList;
						if(this.assess){
						this.assess.forEach(item => {
							this.$set(item, 'assessgreatimg', "http://yueang2.oss-cn-qingdao.aliyuncs.com/wm-img/dianzan_d.png");
							this.$set(item, 'classname', "assesscount");
							if (item.isCardCommentsGreat == 1) {
								item.classname = "assesscount2";
								item.assessgreatimg = "http://yueang2.oss-cn-qingdao.aliyuncs.com/wm-img/dianzn.png";
							}
						})
						}
						this.card_msg = {
							cardId: data.cardId,
							companyId: data.companyId,
							picchecked: data.logo || '',
							username: data.name || '',
							tel: data.phone || '',
							wx: data.personalWx || '',
							company_wx: data.companyWx || '',
							email: data.email || '',
							post: data.position || '',
							company: data.companyName,
							company_logo: data.companyLogo,
							browseNum: data.browseNum || 0,
							thumbsNum: data.thumbsNum,
							address: data.address || '',
							browsePhoto: data.browsePhoto ? data.browsePhoto.split(',') : [],
						};
						this.introduce = data.briefIntroduction || '';
						this.self_photos = data.photo ? data.photo.split(',') : [];
						this.card_type = data.style + 1;
						this.type = data.cardType;
						this.isThumbs = data.isThumbs;
						wx.setStorageSync('CARDTEL', data.phone);

						this.setCurrentCompany(data);
						if (this.currentCompany.userId === wx.getStorageSync('userId')) {
							this.isShowTalk = false;
						} else {
							this.isShowTalk = true;
							this.targetAvatarUrl = this.currentCompany.logo;
						}
						this.$nextTick(() => {
							this.getIntroHeight();
						})
					}
				}).catch((err) => {
					this.card_msg = {};
					console.log(err);
					wx.hideLoading();
				});
			},
			toCardCase() {
				//名片夹
				wx.redirectTo({
					url: "../cardCase/main"
				});
			},
			getIntroHeight() {
				let v = this;
				wx.createSelectorQuery()
					.select(".introduce")
					.boundingClientRect(function(rect) {
						if (!rect) return;

						if (rect.height < 107) {
							v.moreShow = false;
						} else {
							v.moreShow = true;
						}
						v.introHeight = rect.height + "px";
					})
					.exec();
			},
			//音频播放
			audioPlay(e) {
				var that = this,
					id = e.currentTarget.dataset.id,
					key = e.currentTarget.dataset.key,
					audioArr = that.audioArr,
					vidSrc = audioArr.src;

				if (!vidSrc) {
					return;
				}

				myaudio.src = vidSrc;
				myaudio.autoplay = true;
				myaudio.startTime = 0;

				//切换显示状态
				that.$set(that.audioArr, "bl", true);
				// audioArr.bl = true;

				//开始监听
				myaudio.onPlay(() => {
					that.audioArr = audioArr;
				});

				//结束监听
				myaudio.onEnded(() => {
					audioArr.bl = false;
					myaudio.stop();
					myaudio.destroy();
					myaudio = wx.createInnerAudioContext();
					myaudio.obeyMuteSwitch = false;
					that.$set(that.audioArr, "bl", false);
				});
			},
			// 音频停止
			audioStop(e) {
				var that = this,
					key = e.currentTarget.dataset.key,
					audioArr = that.audioArr;
				//切换显示状态
				audioArr.bl = false;

				myaudio.stop();
				myaudio.destroy();
				myaudio = wx.createInnerAudioContext();
				myaudio.obeyMuteSwitch = false;
			},
			createCode() {
				if (!HandleLogin.returnIsLogin()) {
					this.loginGuide();
					return;
				}
				WXAJAX.POST({
					cardId: this.CARDID,
				}, '', '/businessCard/getWxTwoCode').then((data) => {
					wx.navigateTo({
						url: '/pages/cardCode/main?code=' + data
					})
				}).catch((err) => {
					wx.hideLoading();
				});
			},
			page_turn(url) {
				//名片夹
				if (url === "cardCode") {
					wx.setStorageSync({
						wxCodeMsg: {
							name: this.card_msg.name,
							logo: this.card_msg.logo,
							company_logo: this.card_msg.company_logo,
							post: this.card_msg.post,
						}
					})
					wx.navigateTo({
						url: '../' + url + '/main?companyId=' + this.COMPANYID + '&cardId=' + this.CARDID
					});
				} else {
					wx.navigateTo({
						url: '../' + url + '/main'
					});
				}
				// wx.redirectTo({url:'../'+url+'/main'})
			},
			uploadpic(type) {
				//card2 选择公司图片
			},
			createCard() {
				// if(!HandleLogin.returnIsLogin()){
				//     this.loginGuide();
				//     return ;
				// }
				this.toCreatePage();
			},
			SaveToCustomer() {
				if (!HandleLogin.returnIsLogin()) {
					this.loginGuide();
					return;
				}
				//存为客户
				util.toMiniProgram(
					`/pages/clientAdd/main?type=userAdd&goType=1&cardId=${this.currentCompany.cardId || ''}&userId=${this.currentCompany.userId || ''}`
				);

			},
			updateMyCard() { 
				if (!HandleLogin.returnIsLogin()) {
					this.loginGuide();
					return;
				}
				toMiniProgram(`/pages/editCard/main`);
				
			},
			addToAddressBook() { //添加到通讯录
				wx.addPhoneContact({
					firstName: this.card_msg.username,
					mobilePhoneNumber: this.card_msg.tel,
					organization: this.card_msg.company,
					success: function(res) {
						console.log('success', res);
					},
					fail: function(err) {
						console.log(err)
					}
				})
			},
			makePhone() { //拨打电话
				this.addCallsPhoneRecord(this.card_msg.cardId); // 好像没用，是underfind
				util.MakePhone(this.card_msg.tel || '');
			},
			addWx() { //添加微信
				let v = this;
				if (v.card_msg.wx) {
					wx.setClipboardData({
						data: v.card_msg.wx,
						success: function(res) {
							wx.getClipboardData({
								success: function(res) {
									v.isShowCourse = true;
									wx.showToast({
										title: '复制成功'
									})
								}
							})
						}
					})
				} else {
					wx.showToast({
						title: '还没有添加微信呢！',
						duration: 2000,
						icon: 'none'
					});
				}
			},
			previewImage(src) {
				//点击图片放大
				var v = this;
				wx.previewImage({
					current: src,
					urls: v.self_photos
					// urls必须是数组 不然会报错
				});
			},
			doThumbs() { //点赞
				wx.showLoading();
				WXAJAX.POST({
					cardId: this.CARDID,
				}, '', '/businessCard/doThumbs').then((data) => {
					wx.hideLoading();
					if (this.isThumbs) {
						this.$set(this.card_msg, 'thumbsNum', --this.card_msg.thumbsNum);
					} else {
						this.$set(this.card_msg, 'thumbsNum', ++this.card_msg.thumbsNum);
					}
					this.isThumbs = !this.isThumbs;
				}).catch((err) => {
					wx.hideLoading();
				});
			},

		},

		created() {}
	};
</script>
<style scoped>
	@import url("../../common/index/index.css");
</style>
<style>
	/* 遮罩层 */
	.uni-mask {
		background: rgba(0, 0, 0, 0.6);
		position: fixed;
		width: 100%;
		height: 100%;
		left: 0;
		top: 0;
		z-index: 9998;
	}

	.outbutton {
		display: flex;
		flex-direction: row;
		width: 100%;

	}

	.outbutton button {
		font-size: 25upx;
		width: 45%;
		border: 1upx solid green;
		margin-bottom: 20upx;
		height: 80upx;
		line-height: 80upx;
	}

	.why {
		display: flex;
		flex-direction: row;
		margin-top: 20upx;
		margin-bottom: 20upx;
	}

	.why image {
		width: 70upx;
		height: 70upx;
		border-radius: 50%;
		margin-left: 20upx;
	}

	.why text {
		background-color: #F4F4F5;
		margin-left: 20upx;
		height: 60upx;
		margin-top: 5upx;
		line-height: 60upx;
		font-size: 25upx;
	}

	.indexout image {
		width: 100upx;
		height: 100upx;
		border-radius: 50%;
		margin-top: -50upx;
		margin-left: 70upx;
	}

	.indexout {
		display: flex;
		flex-direction: column;
	}

	.indexout text {
		width: 80%;
		margin-top: 20upx;
		margin-left: 10%;
		margin-bottom: 20upx;
		background-color: #F4F4F5;
		font-size: 25upx;

	}

	/* 弹出层形式的广告 */
	.uni-banner {
		width: 80%;
		position: fixed;
		left: 50%;
		top: 50%;
		background: #FFF;
		border-radius: 10upx;
		z-index: 9999;
		transform: translate(-50%, -50%);
	}

	.moreassess {
		width: 100%;
		text-align: center;
	}

	.moreassess text {
		font-size: 20upx;
		color: #BCBCBC;
	}

	.divline {
		height: 1upx;
		width: 100%;
		background-color: #BCBCBC;
		margin-top: 20upx;
		margin-bottom: 10upx;
	}

	.myaccess {
		display: flex;
		flex-direction: row;
		margin-top: 20upx;
	}

	.myaccess open-data {
		width: 70upx;
		height: 70upx;
		border-radius: 50%;
		margin-bottom: 20upx;
		margin-right: 20upx;

	}

	.myaccess input {
		width: 80%;
		height: 60upx;
		background-color: #f4f4f5;
		margin-top: 5upx;
		font-size: 25upx;
	}

	.assesscount {
		color: #888888;
		font-size: 25upx;
	}

	.assesscount2 {
		color: green;
		font-size: 25upx;
	}

	.mycontent-icon {
		width: 30upx;
		height: 30upx;
		float: left;
		margin-top: 28upx;
		margin-right: 15upx;
	}

	.tx {
		float: right;
		width: 100upx;
		height: 55upx;
		font-size: 20upx;
		border: 1px solid #BCBCBC;
		border-radius: 10upx;
		background-color: white;
		margin-top: -35upx;
		text-align: center;
		line-height: 55upx;
	}

	.tx2 {
		float: right;
		width: 100upx;
		height: 55upx;
		font-size: 20upx;
		border: 1px solid green;
		border-radius: 10upx;
		background-color: white;
		margin-top: -35upx;
		text-align: center;
		line-height: 55upx;
		color: green;
	}

	.xy {
		float: right;
		width: 100upx;
		height: 55upx;
		font-size: 20upx;
		margin-top: -35upx;
		border: 1px solid #BCBCBC;
		border-radius: 10upx;
		background-color: white;
		text-align: center;
		line-height: 55upx;
	}

	.xy2 {
		float: right;
		width: 100upx;
		height: 55upx;
		font-size: 20upx;
		margin-top: -35upx;
		border: 1px solid green;
		border-radius: 10upx;
		background-color: white;
		text-align: center;
		line-height: 55upx;
		color: green;

	}

	.mytag {
		display: flex;
		flex-direction: row;
		border: 1upx solid;
		height: 50upx;
		line-height: 50upx;
		float: left;
		padding-left: 20upx;
		padding-right: 20upx;
		border-radius: 5upx;
		margin-right: 15upx;
		margin-bottom: 10upx;
		font-size: 25upx;
		border-color: #B2B2B2;
	}

	.mytagchange {
		display: flex;
		flex-direction: row;
		border: 1upx solid;
		height: 50upx;
		line-height: 50upx;
		float: left;
		padding-left: 20upx;
		padding-right: 20upx;
		border-radius: 5upx;
		margin-right: 15upx;
		margin-bottom: 10upx;
		font-size: 25upx;
		border-color: #20B31C;
	}

	.mytag image {
		height: 30upx;
		width: 30upx;
		vertical-align: middle;
		margin-top: 10upx;

	}

	.arrow {

		width: 7px;

		height: 7px;

		border-top: 2px solid #999;

		border-right: 2px solid #999;

		transform: rotate(45deg);
		float: right;
		margin-top: 7upx;

	}

	.mytag text {
		margin-left: 5upx;
	}

	.assessinfo {
		display: flex;
		flex-direction: row;
		margin-bottom: 10upx;
	}

	.assess-userinfo {
		display: flex;
		flex-direction: column;
		width: 80%;
	}

	.assessinfo image {
		height: 70upx;
		width: 70upx;
		margin-top: 20upx;
		margin-right: 20upx;
	}

	.assess-likeinfo {
		display: flex;
		flex-direction: row;
		float: right;

	}

	.assess-likeinfo image {
		width: 30upx;
		height: 30upx;
		margin-right: 10upx;
	}

	.company-info {
		display: flex;
		flex-direction: row;
		line-height: 100upx;
	}

	.company-info text {
		font-weight: 600;
		margin-left: 50upx;
	}

	.company-info div {
		width: 100upx;
		height: 45upx;
		font-size: 20upx;
		border: 1px solid #23B227;
		border-radius: 5upx;
		background-color: white;
		margin-top: 25upx;
		text-align: center;
		line-height: 45upx;
		color: #23B227;
	}

	.divLine {
		background: #E0E3DA;
		width: 100%;
		height: 2rpx;
		margin-top: 30upx;
		margin-bottom: 30upx;
	}

	.company-tag {
		display: flex;
		flex-direction: row;
		height: 60upx;
		line-height: 60upx;
		float: left;
		padding-left: 20upx;
		padding-right: 20upx;
		border-radius: 15upx;
		margin-right: 15upx;
		margin-bottom: 10upx;
		background-color: #F5F5F5;

	}

	.employees-info {
		float: left;
		width: 48%;
		display: flex;
		flex-direction: column;
		margin-right: 2%;
		margin-bottom: 10upx;
	}

	.employees-info div {
		width: 100%;
		display: flex;
		flex-direction: column;
		border: 1rpx solid #F4F4F4;
	}

	.employees-info image {
		width: 100%;
		height: 300upx;
	}

	.goods {
		display: flex;
		flex-direction: row;
		margin-bottom: 30upx;
	}

	.goods image {
		width: 45%;
		height: 180upx;
		margin-right: 20upx;
	}

	.goods-info {
		display: flex;
		flex-direction: column;
	}

	.goods-info text {
		margin-bottom: 30upx;
	}

	.more-info {
		position: absolute;
		top: 0;
		bottom: 0;
		right: 0;
		margin: auto;
		height: 262upx;
		width: 30upx;
		background: white;
		/* box-shadow: 0px 0px 20upx 0px rgba(56, 56, 56, 0.1); */
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.more-info .left-img {
		width: 10upx;
		height: 20upx;
	}

	.operation-box {
		margin-left: 130upx;
		margin-right: 20upx;
	}

	.business_card {
		position: absolute;
		box-sizing: border-box;
		left: 0;
		top: 50%;
		transform: translateY(-50%);
		border-radius: 0 50% 50% 0;
		display: flex;
		align-items: center;
		padding-top: 0;
		width: 132upx;
	}

	.business_card p {
		writing-mode: tb-rl;
	}

	.index {
		position: relative;
	}

	.user-btn-group>* {
		margin: 0;
	}

	.card_menu {
		position: relative;
	}

	.scroll-list {
		width: 567upx;
		white-space: nowrap;
		padding: 20upx 40upx 20upx 20upx;
	}

	.scroll-list>div {
		white-space: nowrap;
		box-sizing: border-box;
	}

	.self_introduce {
		min-height: 214upx;
		transition: 0.1s;
		overflow: hidden;
	}

	.self_introduce.higher {
		height: auto;
	}

	.output-audio {
		width: 334upx;
		height: 80upx;
		position: relative;
		margin-right: 22upx;
	}

	.audio::before {
		content: "";
		display: block;
		width: 20upx;
		height: 20upx;
		background: #f5f5f6;
		position: absolute;
		border: 1upx solid #e8e8e8;
		border-radius: 8upx;
		transform: rotate(45deg);
		border-right-width: 0;
		border-top-width: 0;
		top: 0px;
		bottom: 0;
		left: -12upx;
		margin: auto;
	}

	.output-audio .audio {
		padding: 24upx 0 24upx 34upx;
		background: #f5f5f6;
		border: 1upx solid #e8e8e8;
		position: relative;
		height: 30upx;
		border-radius: 10upx;
	}

	.output-audio .audio .ico {
		width: 24upx;
		height: 34upx;
		float: left;
	}

	scroll-view {
		background: #fff;
	}

	.edit-btn {
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.card-case {
		position: fixed;
		right: 0;
		top: 40upx;
		z-index: 999;
	}

	/*定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸*/
	::-webkit-scrollbar {
		width: 0px;
		height: 0px;
		background-color: transparent;
	}

	/*定义滚动条轨道 内阴影+圆角*/
	::-webkit-scrollbar-track {
		-webkit-box-shadow: inset 0 0 20upx transparent;
		border-radius: 20upx;
		background-color: transparent;
	}

	/*定义滑块 内阴影+圆角*/
	::-webkit-scrollbar-thumb {
		border-radius: 20upx;
		-webkit-box-shadow: inset 0 0 20upx transparent;
		background-color: transparent;
	}

	video {
		width: 100%;
		height: 388upx;
		border-radius: 10upx 10upx 0 0;
	}

	.firstVideo {
		width: 100%;
		border-radius: 10upx;
	}

	.firstVideo div {
		line-height: 84upx;
	}

	.notFirstVideo {
		width: 336upx;
		margin-top: 20upx;
		border-radius: 10upx 10upx 0 0;
	}

	.notFirstVideo video {
		height: 188upx;
	}

	.notFirstVideo div {
		line-height: 48upx;
	}

	.create-card {
		align-items: stretch;
	}
</style>
